﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" MasterPageFile="~/Common/MasterPages/Dialog.Master" CodeBehind="NoticeEdit.aspx.cs" Inherits="DMS.Web.Modules.SystemManagement.NoticeEdit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageTitle" runat="server">
    系统公告
</asp:Content>


<asp:Content ContentPlaceHolderID="MainHolder" runat="server">
<script type="text/javascript" src="/Resources/Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="/Resources/Scripts/ckeditor/ckeditor.js"></script>
    <script type="text/javascript">        
        function setValue() {
            $('#<%=ContentValue.ClientID %>').val(editor.getData());
        }

        function uploadImage() {
            var fileInfo = window.showModalDialog("/common/applicationpages/uploadfile.aspx?MaxSize=10485760", null, "dialogheight: 250px; dialogwidth: 650px; dialogtop: px; dialogleft: px; edge:raised; center: yes; help: yes; resizable: yes; status: no;");
            if (fileInfo) {
                var f = fileInfo.split(";");
                editor.insertHtml("<img src='" + "<%=serverPath %>/" + f[1] + "'/>");
            }
        }

        function init() {            
            editor.setData($('#<%=ContentValue.ClientID %>').val());
        }      
    </script>

    <fieldset>
    <legend>
        详细信息
    </legend>
    <div id="mainareacontent">
        <div class="mainarea">
            <!----------- 表单信息 ------------------>
            <table width="100%" cellpadding="0" cellspacing="1" class="formitem">             
              <tr>
                <th width="20%">标题：</th>
                <td colspan="3">
                    <asp:TextBox ID="Title" runat="server" EnableControl="(*.*)" Width="95%"></asp:TextBox>
                    <font color="red">
                        *
                    </font>
                    <asp:RequiredFieldValidator ID="TitleValidator" runat="server" ControlToValidate="Title"
                    ErrorMessage="必须填写公告标题<br/>" Display="Dynamic"></asp:RequiredFieldValidator>
                  </td>               
              </tr>
              <tr>
                 <th>接收群体</th>
                <td>
                    <asp:DropDownList ID="Target" DataValueField="RoleID" AutoPostBack="false" DataTextField="RoleName" runat="server" Width="180px">
                    </asp:DropDownList>
                </td>
                <th> 
                    发布时间：
                </th>
                <td>
                    <asp:TextBox ID="PublishTime" ReadOnly="true" runat="server" EnableControl="(*.*)" Width="180px"></asp:TextBox>                    
                </td>                    
              </tr>
                 
              <tr>                
                  <td colspan="4" style="text-align:center">
                      <asp:TextBox ID="Content" TextMode="MultiLine" runat="server"
                          Columns="50" Rows="10"></asp:TextBox>
                        
                      <asp:HiddenField ID="ContentValue" runat="server" />
                      <span id="Span1" runat="server">
                      <a id="imgBtn" href="javascript:uploadImage();" class="linkbtn"><span>插入图片</span></a>
                      </span>
                  </td>
              </tr>
            </table>          
        </div>
    </div>
    </fieldset>

    <script type="text/javascript">
        var editor = CKEDITOR.replace('<%=Content.ClientID %>',{height:350});        
    </script>
    </asp:Content>

<asp:Content ID="ctFooter" ContentPlaceHolderID="FooterHolder" runat="server">
    <asp:LinkButton ID="btnSave" CssClass="linkbtn" runat="server" OnClientClick="setValue();"
        OnClick="SaveForm" CausesValidation="true"><span>保存</span></asp:LinkButton>&nbsp;&nbsp;
    <a href="javascript:window.close();" class="linkbtn"><span>关闭</span></a>
</asp:Content>
